<iv class="row" ng-controller="SourceListCtrl"> <toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>

<div class="col-lg-12 col-sm-12 col-xs-12">
	<div class="widget">
		<div class="widget-header bordered-bottom bordered-blue">
			<span class="widget-caption">在线发布</span>
			<div class="widget-buttons">
				<a href="" widget-collapse="" class="red"><i class="fa fa-minus"></i></a>
			</div>
		</div>
		<div class="widget-body">
			<div>
				<form id="documentForm" role="form" callback="dropzoneCallback" enctype="multipart/form-data" method="POST" class="dropzone" dropzone="file" action="/source/deploy">
					<div class="well">
						<div class="dz-default dz-message dz-preview"></div>
					</div>
					<script type="text/javascript">
						Dropzone.autoDiscover = false;
					</script>
				</form>
				<button class="btn btn-danger" ng-click="reset()">重置</button>
			</div>
		</div>
	</div>
	<div class="well with-header">
		<div class="header bordered-palegreen">源码查询</div>
		<form id="searchForm">
			<div class="row">
				<div class="col-md-6">
					<div class="form-group">
						<label class="control-label">主文件名称</label> <input type="text" class="form-control" ng-model="model.mainFileName" name="mainFileName" placeholder="请输入主文件名称" />
					</div>
				</div>
				<div class="col-md-6">
					<div class="form-group">
						<label class="control-label">文件分组</label>
						<!-- 						<input type="text" class="form-control" name="mainFileName" placeholder="请输入主文件名称" /> -->
						<select class="select" name="dir" ng-model="model.dir" ng-options="a.path as a.name for a in groupDir">
							<option value="">全部</option>
						</select>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-md-6">
					<button class="btn btn-primary" ng-click="search()">
						<i class="fa fa-search"></i>查询
					</button>
				</div>
				<div class="col-md-6"></div>
			</div>
		</form>
	</div>
</div>
<div class="col-lg-12 col-sm-12 col-xs-12">
	<div class="widget">
		<div class="widget-header bordered-bottom bordered-blue">
			<span class="widget-caption">源码列表</span>
		</div>
		<div class="widget-body">
			<div>
				<table id="table" class="data-list fix-header" cellspacing=0 cellpadding=0 width="100%">
					<thead>
						<tr>
							<th width="5%">序号</th>
							<th width="10%" column="mianFile">主文件</th>
							<th width="20%" column="folder">文件夹</th>
							<th width="10%" column="startTime">上传时间</th>
							<th width="15%">操作</th>
						</tr>
					</thead>
					<tbody>

					</tbody>
				</table>
			</div>
		</div>
	</div>
</iv>

<script type="text/ng-template" id="release.html">
		<div class="modal-header" style="    border-bottom: 3px solid #ed4e2a">
            <h3 class="modal-title">发布系统</h3>
        </div>
	
        <div class="modal-body">
			<div class="widget-body treeDiv">
				<ul id="treeDemo" class="ztree"></ul>
			</div>
			<div class="row detail" style="margin-top:10px;">
				<div class="col-md-12">
					<div class="form-group">
						<label class="control-label">是否开启进程守护: </label> 
						<label>
                        	<input class="checkbox-slider colored-blue" ng-model="open" type="checkbox">
                            <span class="text"></span>
                        </label>
					</div>
				</div>
			</div>
			<div class="row detail" style="margin-top:10px;">
				<div class="col-md-12">
					<div class="form-group">
						<label class="control-label">发布路径</label> 
						<input type="text" class="form-control" ng-model="dirname" name="dirname" placeholder="发布路径" />
					</div>
				</div>
			</div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-warning" ng-click="cancel()">返回</button>
			<button class="btn btn-blue" ng-click="ok()">发布</button>
        </div>
	</script>

<script type="tpl" id="program_list_tpl">
         {@each list as item,index}
         <tr>
             <td><label>&{parseInt(index)+1}</label></td>
             <td><label>&{item.mianFile == null ? '' : item.mianFile}</label></td>
             <td><label>&{item.folder == null ? '' : item.folder}</label></td>
             <td><label>&{item.createTime == null ? '' : new Date(item.createTime).format()}</label></td>
			 <td>
				<ul>
					<li ng-click="release('&{item.folder}','&{item.sourceInfoFile}')" class="btn btn-default btn-xs black">
						<i class="fa fa-paper-plane-o"></i>发布</a>
					</li>
					<li ng-click="remove('&{item.folder}','&{item.sourceInfoFile}')" class="btn btn-default btn-xs black">
						<i class="fa fa-trash-o"></i>删除</a>
					</li>
					<li ng-click="releaseStart('&{item.folder}','&{item.sourceInfoFile}')" class="btn btn-default btn-xs black">
						<i class="fa fa-retweet"></i>重新发布</a>
					</li>
				</ul>
			 </td>
         </tr>
         {@/each}
</script>